import http from "./http";

const getAllTags = (v) => {
    return http({
        method: "get", //请求方法
        url: "/api/admin/tag/list" + "/" + v.pageNum + "/" + v.pageSize,
        responseType: "json",
        headers: {
            "Content-Type": "application/json",
        },
    });
}

const deleteTag = (tid) => {
    return http({
        method: "delete", //请求方法
        url: `/api/admin/tag/delete/${tid}`,
        responseType: "json",
        headers: {
            "Content-Type": "application/json",
        },
    });
}

const addTag = (v) => {
    return http({
        method: "post", //请求方法
        url: `/api/admin/tag/add`,
        data: v,
        responseType: "json",
        headers: {
            "Content-Type": "application/json",
        },
    });
}
const updateTag = (v) => {
    return http({
        method: "post", //请求方法
        url: `/api/admin/tag/update`,
        data: v,
        responseType: "json",
        headers: {
            "Content-Type": "application/json",
        },
    });
}

export { getAllTags, deleteTag, addTag, updateTag };